<template>
  <div class="">
    我是2组件（发送方 ）
    <button @click="send">发送信息</button>
    <p>{{color}}</p>
    <p>{{userinfo.age}}</p>
  </div>
</template>
<script >
import Bus from "../../utils/EventBus";
export default {
  data() {
    return {};
  },
  inject:['color','userinfo'],
  props: [],
  components: {},
  created() {},
  mounted() {},
  methods: {
    send() {
      Bus.$emit("sendMsg", "今天天气不错");
    },
  },
};
</script>
<style lang='less' scoped>
</style>